/**
 * 
 */
package com.ssm.enums;

/**
 * @author xieqiang_daye
 *
 */
public enum AppointStateEnum {
	SUCESS(1,"预约成功"),NO_NUMBER(0,"库存不足"),REPEAT_APPOINT(-1,"重复预约"),INNER_ERROE(-2,"系统异常");
	
	private int state;
	
	private String stateInfo;
	
	private AppointStateEnum(int state,String stateInfo){
		this.state = state;
		this.stateInfo = stateInfo;
	}

	public String getStateInfo() {
		return stateInfo;
	}

	public int getState() {
		return state;
	}

	public static AppointStateEnum stateOf(int index){
		for(AppointStateEnum state:values()){
			if(state.getState()==index){
			   return state;
			}
		}
		return null;
	}
}